package com.ruoyi.project.channel.channelAccountSub.service;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.channel.channelAccountSub.mapper.ChannelAccountSubMapper;
import com.ruoyi.project.channel.channelAccountSub.domain.ChannelAccountSub;
import com.ruoyi.project.channel.channelAccountSub.service.IChannelAccountSubService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 子账号 服务层实现
 * 
 * @author CAIN
 * @date 2019-09-26
 */
@Service
public class ChannelAccountSubServiceImpl implements IChannelAccountSubService 
{
	@Autowired
	private ChannelAccountSubMapper channelAccountSubMapper;

	/**
     * 查询子账号信息
     * 
     * @param subAccountId 子账号ID
     * @return 子账号信息
     */
    @Override
	public ChannelAccountSub selectChannelAccountSubById(Long subAccountId)
	{
	    return channelAccountSubMapper.selectChannelAccountSubById(subAccountId);
	}
	
	/**
     * 查询子账号列表
     * 
     * @param channelAccountSub 子账号信息
     * @return 子账号集合
     */
	@Override
	public List<ChannelAccountSub> selectChannelAccountSubList(ChannelAccountSub channelAccountSub)
	{
	    return channelAccountSubMapper.selectChannelAccountSubList(channelAccountSub);
	}
	
    /**
     * 新增子账号
     * 
     * @param channelAccountSub 子账号信息
     * @return 结果
     */
	@Override
	public int insertChannelAccountSub(ChannelAccountSub channelAccountSub)
	{
	    return channelAccountSubMapper.insertChannelAccountSub(channelAccountSub);
	}
	
	/**
     * 修改子账号
     * 
     * @param channelAccountSub 子账号信息
     * @return 结果
     */
	@Override
	public int updateChannelAccountSub(ChannelAccountSub channelAccountSub)
	{
	    return channelAccountSubMapper.updateChannelAccountSub(channelAccountSub);
	}

	/**
     * 删除子账号对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteChannelAccountSubByIds(String ids)
	{
		return channelAccountSubMapper.deleteChannelAccountSubByIds(Convert.toStrArray(ids));
	}
	
}
